﻿{% extends "base.html" %}
{% load i18n %}
<body>
{% block js %}
<script type="text/javascript" src="/assets/js/jquery.SuperSlide.js"></script>
<!--[if IE 6]>
<script type="text/javascript" src="/assets/js/DD_belatedPNG.js"></script>
<script>DD_belatedPNG.fix('#focusAd .bg,#focusAd .con,#focusAd .prev,#focusAd .next');</script>
<![endif]-->
{% endblock %}
{% block menu %}
    <li><a href="/" class="cur">{% trans 'Home' %}</a></li>
    <li><a href="/case/search/">{% trans 'Case Query' %}</a></li>
    <li><a href="/case/add/">{% trans 'Add Case' %}</a></li>
    <li><a href="/case/category/">{% trans 'Category' %}</a></li>
    <li><a href="/contact/">{% trans 'Contact Us' %}</a></li>
{% endblock %}
{% block detail %}
    <div class="main">
        <div id="focusAd" class="tv-slideBox">
            <a class="prev"></a><a class="next"></a>
            <div class="bd">
                <ul>
                    {% for flash in flashs %}
                        <li class="li{{ forloop.counter }}">
                            <div class="pic"><img src="/file/{{ flash.img }}"></div>
                            <div class="con">
                                <div class="bg"></div>
                                <div class="title">{{ flash.title }}</div>
                                <div class="intro">{{ flash.content }}</div>
                            </div>
                        </li>
                    {% endfor %}
                </ul>
            </div>
            <div class="hd">
                <ul>
                    {% for flash in flashs %}
                        <li class="li{{ forloop.counter }}"><span>{{ forloop.counter }}</span></li>
                    {% endfor %}
                </ul>
            </div>
        </div>
        <script language="javascript"> jQuery("#focusAd").slide({ mainCell:".bd ul",effect: "leftLoop",autoPlay:true});</script>


        <div class="i_left">
            {% for category,cases in category_cases.items %}
              {% if forloop.counter|divisibleby:"2" %}
                  <div class="caseblock">
                      <h2 class="tlt03"><a href="/list/?category={{category.id}}&type=common&no=" target="_blank">{% trans 'More' %}&gt;&gt;</a><span class="cl">{% ifequal LANGUAGE_CODE 'en' %}{{ category.name }}{% else %}{{ category.name_cn }}{% endifequal %}</span></h2>
                      <ul>
                          {% for case in cases %}
                              {% if case.img %}
                                  <dt>
                                      <a href="/case/{{ case.id }}" target="_blank">
                                          <img src="/file/{{ case.img }}-280x210" width="282" height="158">
                                      </a>
                                  </dt>
                              {% endif %}
                              <dd>
                                  <h2><a href="/case/{{ case.id }}" target="_blank" title="{{ case.name|striptags}}">{{ case.name|striptags }}</a></h2>
                                  {% if case.img %}
                                      <p>{{ case.brief|truncatechars:46 }}</p>
                                  {% else %}
                                      <p>{{ case.brief|truncatechars:160 }}</p>
                                  {% endif %}
                                  <div class="fix"><a href="case/{{ case.id }}" target="_blank">{% trans 'More' %}&gt;&gt;</a></div>
                              </dd>
                          {% endfor %}
                      </ul>
                  </div>
                  </div>
              {% else %}
                  <div class="caseWrap2 cfl">
                  <div class="caseblock">
                      <h2 class="tlt03"><a href="/list/?category={{category.id}}&type=common&no=" target="_blank">{% trans 'More' %}&gt;&gt;</a><span class="cl">{% ifequal LANGUAGE_CODE 'en' %}{{ category.name }}{% else %}{{ category.name_cn }}{% endifequal %}</span></h2>
                      <ul>
                          {% for case in cases %}
                              {% if case.img %}
                                  <dt>
                                      <a href="/case/{{ case.id }}" target="_blank">
                                      <img src="/file/{{ case.img }}-280x210" width="282" height="158">
                                      </a>
                                  </dt>
                              {% endif %}
                              <dd>
                                  <h2><a href="/case/{{ case.id }}" target="_blank" title="{{ case.name|striptags}}">{{ case.name|striptags }}</a></h2>
                                      {% if case.img %}
                                          <p>{{ case.brief|truncatechars:46 }}</p>
                                      {% else %}
                                          <p>{{ case.brief|truncatechars:160 }}</p>
                                      {% endif %}
                                  <div class="fix"><a href="case/{{ case.id }}" target="_blank">{% trans 'More' %}&gt;&gt;</a></div>
                              </dd>
                          {% endfor %}
                      </ul>
                  </div>
              {% endif  %}
            {% endfor %}

        </div>
        <div class="i_right">
            <div class="caseWrap2">
                <div class="listblock">
                    <h2 class="h2_tlt"><a href="/list/?category=&type=latest&no=" target="_blank">{% trans 'More' %}&gt;&gt;</a>{% trans 'Latest' %}</h2>
                    <ul>
                        {% for case in latest_cases %}
                            <li><a href="/case/{{ case.id }}" target="_blank" title="{{ case.name|striptags}}">{{ case.name|striptags }}</a></li>
                        {% endfor %}
                    </ul>
                </div>
                <div class="listblock">
                    <h2 class="h2_tlt"><a href="/list/?category=&type=rank&no=" target="_blank">{% trans 'More' %}&gt;&gt;</a>{% trans 'Rank' %}</h2>
                    <ul>
                        {% for case in hotest_cases %}
                            <li><a href="/case/{{ case.id }}" target="_blank" title="{{ case.name|striptags}}">{{ case.name|striptags }}</a></li>
                        {% endfor %}
                    </ul>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
</body>
</html>